#include<stdio.h>
struct Student{
    char name[20];
    int chinese,math,english;
}student[1000];
int main(){
    int n;
    scanf("%d",&n);
    int final[1000]={0};
    for(int i=1;i<=n;i++){
        scanf("%s %d %d %d",student[i].name,&student[i].chinese,&student[i].math,&student[i].english);
        final[i]=student[i].chinese+student[i].math+student[i].english; 
    }
    int max=0,max_member=1;
    for (int i=1;i<=n;i++){
        if(final[i]>max){
            max=final[i];
            max_member=i;
        }
    }
    printf("%s %d %d %d",student[max_member].name,student[max_member].chinese,student[max_member].math,student[max_member].english);
}